package com.zyicoding.myfactory.controller;

import com.zyicoding.myfactory.service.EmployeeService;
import com.zyicoding.myfactory.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin(origins = "*",maxAge = 3600)
@RestController("manager")
public class ManagerController {
    @Autowired
    private EmployeeService employeeService;

    /**
     * 插入随机员工
     *
     * @return
     */
    @PostMapping("insertEmployee")
    public JsonResult insertEmployee() {
        return JsonResult.ok(employeeService.insertEmployee());
    }

}
